package com.globallogic.jira.gadget.renderer;

import com.atlassian.jira.issue.Issue;

/**
 * Tree renderer for report
 * 
 * @author anton.pereverziev
 * 
 */
public class TreeRendererForGadget extends AbstractTreeRenderer {

	@Override
	public String getNodeContent(Issue issue) {
		StringBuilder content = new StringBuilder();
		content.append("<a href=\"/jira/browse/" + issue.getKey()
				+ "\" target=\"_parent\"> \n");
		content.append(getIssueKey(issue));
		content.append("</a> \n");
		content.append("<img src=\"/jira"
				+ issue.getPriorityObject().getIconUrl() + "\"/> \n");
		content.append("<img src=\"/jira"
				+ issue.getIssueTypeObject().getIconUrl() + "\"/> \n");
		content.append("<img src=\"/jira"
				+ issue.getStatusObject().getIconUrl() + "\"/> \n");
		content.append(issue.getSummary() + "\n");
		return content.toString();
	}

}
